import React from "react"
import { Helmet } from "react-helmet"

export default function Head(props) {
  const title = [
    props.title,
    props.pageContext.frontmatter ? props.pageContext.frontmatter.title : false,
    props._frontmatter ? props._frontmatter.title : false,
    "Mallfoundry",
  ]
    .filter(Boolean)
    .join(" – ")
  return (
    <Helmet htmlAttributes={{ lang: "en-US" }}>
      <title>{title}</title>
    </Helmet>
  )
}
